//Problem: 100
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <iostream>
using namespace std;

#ifndef ONLINE_JUDGE
#include "testcode.h"
#else
struct Test {};
#endif
struct Tester : public Test {
	~Tester() {
		while (!cin.eof() && !cin.fail()) {
			 if (cin.get() != '\n') {
				 cin.unget();
				 break;
			 }
		}
	}
};

unsigned int length(unsigned int number) {
	unsigned int result(1);
	while (number != 1) {
		++result;
		if ((number & 1) == 0) {
			number = number / 2;
		} else {
			number = number * 3 + 1;
		}
	}
	return result;
}

int main(int argc, char* argv[]) {
    while (!cin.eof() && !cin.fail()) {
		Tester tester; tester;

		unsigned int a, b;
		cin >> a >> b;
		unsigned int maxlength(0);
		for (unsigned int i = min(a, b), top = max(a, b); i <= top; ++i) {
			maxlength = max(maxlength, length(i));
		}

		cout << a << " " << b << " " << maxlength << "\n";
	}
	return 0;
}

